#include <iostream>
using namespace std;
double TotalCost(int number_par, double price_par); //函数声明
//计算以单价price_par购买number_par件商品的总价，包含了5%的消费税
int main()
{
    double price, bill;
    int number;
    number = 100;
    price = 5.0;
    cout << "您准备购买" << number << "件商品\n";
    cout << "每一件商品的价值为" << price << endl;
    bill = TotalCost(number, price);
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(2);
    cout << "您一共花费了" << bill << "元";
    return 0;
}

double TotalCost(int number_par, double price_par) //函数声明
{
    const double tax_rate = 0.05; // 5%的消费税
    double subtotal;
    subtotal = price_par * number_par;
    return (subtotal + subtotal * tax_rate);
}